﻿@model S4Store.Models.Markting.WZXJBModel
@{
    Layout = null;
    ViewBag.Title = "WZXJB";

    S4Store.Models.Chart.Column ChartModel = new S4Store.Models.Chart.Column();
    ChartModel.Name = "网站性价对比";
    ChartModel.YAxis = "比率(%)";
    foreach (var report in Model.MediaReports)
    {
        ChartModel.XAxis.Add(report.Media.Name);
    }
    S4Store.Models.Chart.ChartSeries series1 = new S4Store.Models.Chart.ChartSeries();
    series1.Name = "资金投入比";
    foreach (var report in Model.MediaReports)
    {
        series1.Data.Add(report.ZJTRB);
    }
    ChartModel.Serieses.Add(series1);
    
    S4Store.Models.Chart.ChartSeries  series2 = new S4Store.Models.Chart.ChartSeries();
    series2.Name = "获取信息比";
    foreach (var report in Model.MediaReports)
    {
        series2.Data.Add(report.HQXXB);
    }
    ChartModel.Serieses.Add(series2);

    List<S4Store.Models.Chart.AdvIndex> RedGreenIndexs2 = new List<S4Store.Models.Chart.AdvIndex>();
    foreach (var report in Model.MediaReports)
    {
        S4Store.Models.Chart.AdvIndex index = new S4Store.Models.Chart.AdvIndex();
        if (report.HQXXB >= report.ZJTRB)
        {
            index.Type = S4Store.Models.Chart.AdvIndex.IndexType.Green;
        }
        else
        {
            index.Type = S4Store.Models.Chart.AdvIndex.IndexType.Red;
        }
        index.Value = (report.HQXXB - report.ZJTRB).toInt() + "%";
        index.Item1Name = "总资金投入";
        index.Item1Value = report.GroupReport.YDFY.toInt(2)+"万";
        index.Item2Name = "本站投入";
        index.Item2Value = report.YDFY.toInt(2) + "万";
        RedGreenIndexs2.Add(index);
    }

}
<div style="height:100%; overflow:auto">
@Html.Action("ReportBar", "Common", Model.BarModel)
<div style="position:relative; width:100%">
      
        @Html.Partial("../Chart/Column", ChartModel)
        @Html.Partial("../Chart/AdvIndex", RedGreenIndexs2)
    
</div>
</div>


